<?php
$obj=new mysql($config);


$id=$_GET['cid'];

$sql="select * from `news` where `cid`=$id";
$date=$obj->getCondition($sql);





if($_GET['pid']==0){
$sql="select pid,id,name,cate_type from `cate` where `cate_type`=1 and `pid`=$id";
$col=$obj->getCondition($sql);

$sql1="select * from `cate` where `cate_type`=1";
$d=$obj->getCondition($sql);
$ids=implode(',',getid($d,$id));
$sql2="select * from `news` where `cid` in($ids)";
$date=$obj->getCondition($sql2);

//link
$sql="select * from `cate` where `cate_type`=1 and `id`=$id";
$d=$obj->getOne($sql);
$link[]=$d;
}
else{
  $sql="select pid,id,name,cate_type from `cate` where `cate_type`=1 and `pid`=$_GET[pid]";
  $col=$obj->getCondition($sql);

//link
$sql1="select * from `cate` where `cate_type`=1";
$sj=$obj->getCondition($sql1);
$link=getlink($sj,$id);
}








require_once VIEW_PATH.'home/layout.html';
